<div class="mainTop" style="background-color:#EFEFEF;">
	<h3>模型目录位置：</h3>
	<div class="input_wrap" id="cubedic">
		<img src="/assets/images/ctr-icons-13.png" height="16"> <input
			id="dicinput" type="text" value="数据模型目录（/）" class="txt_1 txt"
			onclick="showMenu(this)" readOnly="readOnly"
			style="width:260px;border: 1px solid #09f;"> <a
			href="javascript:showMenu(this)" id="cubelist"><i
			class="selectIco"></i> </a>

	</div>
	<!-- <div class="butIcoCon">
		<ul>
			<li><i class="butIco_1"></i>|</li>
			<li><i class="butIco_2"></i><i class="butIco_3"></i>|</li>
			<li><i class="butIco_4"></i><i class="butIco_5"></i><i
				class="butIco_6"></i>
			</li>
		</ul>
	</div>
	 -->
</div>
<div class="leftList" style="height:240px;">
	<ul>
		<li <#if type?? && type == "pub">class="cur"</#if>><a href="/${orgi}/design/query/selcube/${reportid!''}/pubtab.html?modelid=${modelid!''}" data-toggle="load" data-target="#cubeList"><i class="imgIco-15"></i>数据模型目录</a></li>
	</ul>
</div>
<div class="rightCon" style="width:645px !important;height:240px;overflow-y:auto;">
	<div class="rightList" id="cubeList"><#include "cubedic.html"/></div>
</div>
<script type="text/javascript">
	function onClick(e, treeId, treeNode) {
		var zTree = $.fn.zTree.getZTreeObj("treeDemo"),
		nodes = zTree.getSelectedNodes(),
		v = "";
		nodes.sort(function compare(a,b){return a.id-b.id;});
		for (var i=0, l=nodes.length; i<l; i++) {
			v += nodes[i].name + ",";
		}
		if (v.length > 0 ) v = v.substring(0, v.length-1);
		var cityObj = $("#cubedic");
		cityObj.attr("value", v);
		$("#dicinput").val(treeNode.name);
	}

	function showMenu() {
		var cityObj = $("#cubedic");
		var cityOffset = $("#cubedic").position();
		$("#menuContent").css({left:cityOffset.left+"px", top:(cityOffset.top+25)+"px"}).show();

		$("body").bind("mousedown", onBodyDown);
	}
	function hideMenu() {
		$("#menuContent").hide();
		$("body").unbind("mousedown", onBodyDown);
	}
	function onBodyDown(event) {
		if (!(event.target.id == "menuBtn" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
			hideMenu();
		}
	}
	var setting = {
		view: {
			dblClickExpand: false
		},
		data: {
			simpleData: {
				enable: true
			}
		},
		callback: {
			onClick: onClick
		}
	};
	
	$(function(){

		/**
		$(".leftList ul li").hover(function(){
			$(this).addClass("cur").siblings("li").removeClass("cur");
		},function(){
			$(this).removeClass("cur");	
		});
		**/
		var lefeHeight=$(".leftList").outerHeight(),rightHeight=$(".rightList").outerHeight();
		
		$('.leftList li').on("click" , function(){
			$(".cur").each(function(){
				$(this).removeClass("cur");
			});
			$('#dicinput').val($(this).text());
			$(this).addClass("cur");
		}) ;
	});
</script>